package com.example.homeworkmanagement.controller;


import com.example.homeworkmanagement.pojo.Administrator;
import com.example.homeworkmanagement.service.AdministratorService;
import com.example.homeworkmanagement.vo.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 拒绝加班
 * @since 2025-05-25
 */
@RestController
@RequestMapping("/administrator")
@Api(tags="管理员信息管理",description="提供管理API接口")
@CrossOrigin
public class AdministratorController {
    @Autowired
    private AdministratorService administratorService;
    @GetMapping("/login")
    @ApiOperation("管理员登录")
    @ApiImplicitParams({
            @ApiImplicitParam(dataType = "string",name = "account",value = "管理员账号",required = true),
            @ApiImplicitParam(dataType = "string",name = "password",value = "密码",required = true),
    })
    public ResultVO<Administrator> login(String account, String password) throws Exception {
        return administratorService.login(account,password);
    }
}
